Before going to develop any model we need to import some inbuild python library. These library help to build machine learning model.

Import Library

In [ ]:
#Following python code will help you to import one of the popular library numpy and pandas.
import pandas as pd 
import numpy as np  

#Following python code will help you to import Date stuff
from datetime import datetime
from datetime import timedelta

#Following python code will help you to import Library for Nice data visulization
import seaborn as sns
import matplotlib.pyplot as plt
import statsmodels.formula.api as sn
%matplotlib inline

# Some times we have some warnings in red if you want to gnore warnings then you need touse below code
import warnings
warnings.filterwarnings('ignore')

# Settings- if we want to see our all features in jupyter notebook then need to run following setting codes.
# It is not mendatory to do so but its recomendation to do that.
pd.set_option('display.max_columns', None)
np.set_printoptions(threshold=np.nan)
np.set_printoptions(precision=3)
sns.set(style="darkgrid")
plt.rcParams['axes.labelsize'] = 14
plt.rcParams['xtick.labelsize'] = 12
plt.rcParams['ytick.labelsize'] = 12

#Following python code will help you to import Library for statistics operation
import scipy.stats as stats


#Following python code will help you to import Machine learning Library

#following code is help to create statsmodels.api model
import statsmodels.api as sm
from sklearn import metrics

#Following library will help to splt data set into training and testing
from sklearn.cross_validation import train_test_split 

# Following library will help to build liner regression model
from sklearn.linear_model import LinearRegression

# Following library will help to build logistic regression model
from sklearn.linear_model import LinearRegression

# Following library will help to build Random forrest model
from sklearn.ensemble import RandomForestRegressor    

# Following library will help to build decision tree model
from sklearn.tree import DecisionTreeRegressor

# Following library will help to build AdaBoostRegressor model
from sklearn.ensemble import AdaBoostRegressor        

# Following library will help to build AdaBoostRegressor model
from sklearn.ensemble import GradientBoostingRegressor 

# Following library will help to build SVC and LinearSVC model
from sklearn.svm import SVC, LinearSVC     

# Following library will help to calculate accuracy of model
from sklearn.metrics import mean_squared_error as mse
from sklearn.metrics import mean_absolute_error, mean_squared_error